package edu.umd.ion.wavemeter.service;


/**
 * Hold constants of the Wavemeter. And routines to check whether some parameter
 * is in range.
 * @author monroe-lab
 *
 */
public class WavemeterParameters {
	public static final int	cSignal1Interferometers = 0;
	public static final int	cSignal1WideInterferometer = 1;
	public static final int	cSignal1Grating = 1;
	public static final int	cSignal2Interferometers = 2;
	public static final int	cSignal2WideInterferometer = 3;
	public static final int	cSignalAnalysis = 4;
	public static final int	cSignalAnalysisX = 4;
	public static final int	cSignalAnalysisY = 5;

	public static final int	cReturnWavelengthVac = 0;
	public static final int	cReturnWavelengthAir = 1;
	public static final int	cReturnFrequency = 2;
	public static final int	cReturnWavenumber = 3;
	public static final int	cReturnPhotonEnergy = 4;

	
	public static final int NumPatterns = 6;
	
	/**
	 * Number of Channels of the Wavemeter.
	 */
/*	public static final int NumRawChannels = 8;
	public static final int NumVirtChannels = 16;
	public static final int NumPIDChannels = 16;
*/	
	public static final String Username = "Username";
	public static final String FiberSwitcherPortName = "COM1";

	/**
	 * Check whether a given channel number is valid. The Wavemeter used channel numbers 1 to 8.
	 * This program uses numbers 0 to 7. The conversion between the different ranges happens when
	 * the WameneterLibrary functions are called or return a channel number.
	 * @param channel
	 * @param caller to be reported in the Exception
	 * @throws WavemeterParameterException
	 */
	public static void checkChannel(int channel,String caller) throws WavemeterParameterException {
		if (channel<0 || channel>=16 /*NumVirtChannels*/ )
			throw new WavemeterParameterException(caller+" channel "+(channel+1)+" out of range");
	}
}
